<%-- 
    Document   : spdcf_detail
    Created on : Jan 6, 2009, 2:33:15 PM
    Author     : User
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <script>
        function approve(){
            window.location = "/elpro/spdcf_productionApprove.do";
        }
    </script>
    <body>
        <h2>Spdcf Detail</h2>
        <table>
            <tr>
                <td>No Quotation</td>
                <td>:</td>
                <td><c:out value="${spdcf.inquery.noQuotation}"/></td>
            </tr>
        
        <tr>
            <td>BusinessPartner</td>
            <td>:</td>
            <td><c:out value="${spdcf.customer.nama}"/></td>
        </tr>  
       
        <tr>
        <td>Alamat Pengiriman</td> 
        <td>:</td>
        <td><c:out value="${spdcf.alamatPengiriman}"/></td>
        <tr>
        </table>
        <table border="1">
            <tr class="table_header">
                <th>No</th>
                <th>Code</th>
                <th>Description</th>
                <th>Weight</th>
                <th>Quantity</th> 
                <th>Price HPP</th>
                <th>Margin Keuangan<th>
                <th>Note</th>    
                <th>Action</th>
            </tr>
            <c:set var="x" value="0"/>
            <c:set var="totalPriceHpp" value="0"/>
            <c:set var="totalMarginKeuangan" value="0"/>
                <c:forEach items="${listSpdcfItem}" var="item">
                    <tr>
                        <td>${x+1}.</td>
                        <td>${item.produk.kode}</td>
                        <td>${item.produk.nama}</td>
                        <td>${item.produk.weight}</td>
                        <td>${item.jumlah}</td>  
                        <td>${item.priceHpp}</td>
                        <td>${item.marginKeuangan}</td>
                        <td>${item.note}</td>                        
                        <td><html:link action="/spdcf_financeEditItem" paramName="item" paramProperty="produk.id" paramId="id">Edit</html:link></td>
                    </tr>
                    <c:set var="x" value="${x+1}"/>
                    <c:set var="totalPriceHpp" value="${totalPriceHpp+item.priceHpp}"/>
                    <c:set var="totalMarginKeuangan" value="${totalMarginKeuangan+item.marginKeuangan}"/>
                </c:forEach>
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>Total</td>
                    <td><c:out value="${totalPriceHpp}"/></td>
                    <td><c:out value="${totalMarginKeuangan}"/></td>
                </tr>
                <tr class="table_footer">
                    <td colspan="10">PT. Dhemar Nusantara - PT. Rahmi Ida Nusantara</td>
                </tr>
        </table>    
        <table>
            <tr>
                <td>Note</td>
                <td>:</td>
                <td><c:out value="${spdcf.note}"/></td>                
            </tr>
            <tr>
                <td>Transportation</td>
                <td>:</td>
                <td><c:out value="${spdcf.transportation}"/></td>                
            </tr>
            <tr>
                <td>PPN</td>
                <td>:</td>
                <td><c:out value="${spdcf.ppn}"/></td>                
            </tr>
            <tr>
                <td>Validity Price</td>
                <td>:</td>
                <td><c:out value="${spdcf.validityPrice}"/></td>                
            </tr>    
            <tr>
                <td>Validity LE</td>
                <td>:</td>
                <td><c:out value="${spdcf.validityStockLE}"/></td>
            </tr>
            <tr>
                <td>Production Time</td>
                <td>:</td>
                <td>
                    <c:if test="${spdcf.productionTime==0}">
                        days after receive this PO in normal condition + Agreement, days <c:out value="${spdcf.productionTimeDays}"/>                        
                    </c:if>
                    <c:if test="${spdcf.productionTime==1}">
                        days after PO on schedule was done + Agreement, days <c:out value="${spdcf.productionTimeDays}"/> 
                    </c:if>
                </td>               
            </tr>     
            <tr>
                <td>Production Condition</td>
                <td>:</td>
                <td>
                    <c:if test="${spdcf.productionCondition==0}">
                        Ready Stock
                    </c:if>
                    <c:if test="${spdcf.productionCondition==1}">
                        On Schedule
                    </c:if>
                    <c:if test="${spdcf.productionCondition==2}">
                        Waiting List
                    </c:if>
                </td>
            </tr>   
            <tr>
                <td>Finishing</td>
                <td>:</td>
                <td>
                    <c:if test="${spdcf.finishingDays==0}">
                        Hot Dip Galvanized
                    </c:if>
                    <c:if test="${spdcf.finishingDays==1}">
                        Electro Galvanized
                    </c:if>
                    <c:if test="${spdcf.finishingDays==2}">
                        Power Coating
                    </c:if>
                </td>
            </tr>
            <tr>
                <td>Delivery Mode</td>
                <td>:</td>
                <td>
                    <c:if test="${spdcf.deliveryMode==0}">
                        Partial / Progress, <c:out value="${spdcf.deliveryModeDesc}"/>
                    </c:if>
                    <c:if test="${spdcf.deliveryMode==1}">
                        One delivery(100%), <c:out value="${spdcf.deliveryModeDesc}"/>
                    </c:if>                    
                </td>
            </tr>
            <tr>
                <td>Delivery Time</td>
                <td>:</td>
                <td>
                    <c:if test="${spdcf.deliveryTime==0}">
                        Partial / Progress, <c:out value="${spdcf.deliveryTimeDays}"/>
                    </c:if>
                    <c:if test="${spdcf.deliveryTime==1}">
                        One delivery(100%), <c:out value="${spdcf.deliveryTimeDays}"/>
                    </c:if>
                </td>
            </tr>          
            <tr>
                <td><input type="button" value="Approve" onclick="approve()"/></td>
            </tr>
        </table>        
    </body>
</html>
